#ifndef BITMASK_H_
#define BITMASK_H_

#include <stdio.h>

// define the bit type here as bool, which takes 1 char size;
typedef bool bit;

class BitMask
{
public:
	BitMask(int w, int h, int s, int m);
	~BitMask();
	void clear();
	// set the n_th sample in screen x, y to be 1 or 0
	void setMaskBit(int screen_x, int screen_y, int n, bool b);
	// read a blocks of masks by the screen location,
	// read by stamp size
	bit* int readMaskBits(int stamp_x, int stamp_y, int width, int height);
	
private:
	int width;
	int height;
	int stamp_size;
	int sample_rate;
	int num_bit;

	bit* buffer;
	bit* stamp_masks;
	bit* stampBitMasks(int base_x, int base_y);
};

#endif